<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let p = {
      name: '张三',
      age: 10
    }

    let handler = {
      get: function (target, key) {
        return Reflect.get(target, key);
      },
      set: function (target, key, value) {
        Reflect.set(target, key, value);
      }
    }

    let proxy = new Proxy(p, handler);
    proxy.name = "李四";

    console.log(proxy.name);

  </script>
</body>

</html>